<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | Dashboard</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">


    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">

    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" th:href="@{/bower_components/bootstrap/dist/css/bootstrap.min.css}" type="text/css">

    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/bower_components/font-awesome/css/font-awesome.min.css}" type="text/css">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/bower_components/Ionicons/css/ionicons.min.css}" type="text/css">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/dist/css/AdminLTE.min.css}" type="text/css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/dist/css/skins/_all-skins.min.css}" type="text/css">
    <!-- Morris chart -->
    <link rel="stylesheet" th:href="@{/bower_components/morris.js/morris.css}" type="text/css">
    <!-- jvectormap -->
    <link rel="stylesheet" th:href="@{/bower_components/jvectormap/jquery-jvectormap.css}" type="text/css">
    <!-- Date Picker -->
    <link rel="stylesheet" th:href="@{/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css}"
          type="text/css">
    <!-- Daterange picker -->
    <link rel="stylesheet" th:href="@{/bower_components/bootstrap-daterangepicker/daterangepicker.css}" type="text/css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" th:href="@{/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css}" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

    <header class="main-header">
        <div th:include="common/head :: head"></div>
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">

            <div th:include="common/left :: left"></div>
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">


        <!-- Main content -->
        <section class="content">

            <div class="row">

                <!-- /.col -->
                <div class="col-md-12">
                    <!-- Widget: user widget style 1 -->
                    <div class="box box-widget widget-user">
                        <!-- Add the bg color to the header using any of the bg-* classes -->
                        <div class="widget-user-header bg-black"
                             style="background: url('../dist/img/photo1.png') center center;">
                            <h3 class="widget-user-username" th:text="${session.userinfo.nickname}">Elizabeth Pierce</h3>
                            <h5 class="widget-user-desc" th:text="${session.rolename}">Web Designer</h5>
                        </div>
                        <div class="widget-user-image">
                            <img class="img-circle" th:src="${session.userinfo.imgpath}" alt="User Avatar">
                        </div>
                        <div class="box-footer">
                            <div class="row">
                                <div class="col-sm-4 border-right">
                                    <div class="description-block">
                                        <h5 class="description-header">3,200</h5>
                                        <span class="description-text">关注数</span>
                                    </div>
                                    <!-- /.description-block -->
                                </div>
                                <!-- /.col -->
                                <div class="col-sm-4 border-right">
                                    <div class="description-block">
                                        <h5 class="description-header">13,000</h5>
                                        <span class="description-text">粉丝数</span>
                                    </div>
                                    <!-- /.description-block -->
                                </div>
                                <!-- /.col -->
                                <div class="col-sm-4">
                                    <div class="description-block">
                                        <shiro:hasAnyRoles name="教员">
                                        <h5 class="description-header" th:text="${courses.size()}">35</h5>
                                        </shiro:hasAnyRoles>
                                        <shiro:hasAnyRoles name="管理员">
                                            <h5 class="description-header" >0</h5>
                                        </shiro:hasAnyRoles>
                                        <shiro:hasAnyRoles name="普通用户">
                                            <h5 class="description-header" >0</h5>
                                        </shiro:hasAnyRoles>
                                        <span class="description-text">课程数</span>
                                    </div>
                                    <!-- /.description-block -->
                                </div>
                                <!-- /.col -->
                            </div>
                            <!-- /.row -->
                        </div>
                    </div>
                    <!-- /.widget-user -->
                </div>
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-md-12">
                    <!-- About Me Box -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">关于我</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <strong><i class="fa fa-book margin-r-5"></i>用户名</strong>

                            <p class="text-muted" th:text="${session.userinfo.uname}">

                            </p>

                            <hr>

                            <strong  ><i class="fa fa-map-marker margin-r-5"></i>邮箱</strong>

                            <p class="text-muted" th:text="${session.userinfo.email}">Malibu, California</p>

                            <hr>

                            <strong><i class="fa fa-pencil margin-r-5"></i>简介</strong>

                            <p th:text="${session.userinfo.introduce}">

                            </p>

                            <hr>

                            <strong><i class="fa fa-file-text-o margin-r-5"></i>注册日期</strong>

                            <p th:text="${session.userinfo.createtime}">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam fermentum enim neque.</p>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->

                </div>
            </div>
            <!-- /.row  end-->
            <shiro:hasAnyRoles name="教员">
            <!--row three start-->
            <div class="row">
                <div class="col-md-12">

                    <div class="box box-primary">
                        <h2 class="profile-username text-center">课程信息</h2>
                    <!-- /.tab-pane -->
                    <div class="tab-pane" id="timeline">
                        <!-- The timeline -->
                        <ul class="timeline timeline-inverse">
                            <!-- timeline item -->
                            <li th:each="m:${courses}">
                                <i class="fa fa-camera bg-purple"></i>
                                <div class="timeline-item">
                                    <span class="time"><i class="fa fa-clock-o"></i><span th:text="${m.createtime}"> 2 days ago</span></span>
                                    <h3 class="timeline-header" th:text="${m.coursename}">uploaded new photos</h3>
                                    <div class="timeline-body">
                                        <a th:href="@{/seemessagetocourse/(courseid=${m.courseid})}"><img th:src="${m.getImgpath()}" alt="..." class="margin img-responsive"></a>
                                    </div>
                                </div>
                            </li>
                            <!-- END timeline item -->
                        </ul>
                    </div>
                    <!-- /.tab-pane -->
                    </div>
                </div>
            </div>
            </shiro:hasAnyRoles>
            <!--row three end-->

        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <!-- /.content-wrapper -->
    <footer class="main-footer">
        <div th:include="common/footer :: footer"></div>
    </footer>
    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script th:src="@{/bower_components/jquery/dist/jquery.min.js}" type="text/javascript"></script>
<!-- jQuery UI 1.11.4 -->
<script th:src="@{/bower_components/jquery-ui/jquery-ui.min.js}" type="text/javascript"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/bower_components/bootstrap/dist/js/bootstrap.min.js}" type="text/javascript"></script>
<!-- Morris.js charts -->
<script th:src="@{/bower_components/raphael/raphael.min.js}" type="text/javascript"></script>
<script th:src="@{/bower_components/morris.js/morris.min.js}" type="text/javascript"></script>
<!-- Sparkline -->
<script th:src="@{/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js}" type="text/javascript"></script>
<!-- jvectormap -->
<script th:src="@{/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js}" type="text/javascript"></script>
<script th:src="@{/plugins/jvectormap/jquery-jvectormap-world-mill-en.js}" type="text/javascript"></script>
<!-- jQuery Knob Chart -->
<script th:src="@{/bower_components/jquery-knob/dist/jquery.knob.min.js}" type="text/javascript"></script>
<!-- daterangepicker -->
<script th:src="@{/bower_components/moment/min/moment.min.js}" type="text/javascript"></script>
<script th:src="@{/bower_components/bootstrap-daterangepicker/daterangepicker.js}" type="text/javascript"></script>
<!-- datepicker -->
<script th:src="@{/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js}"
        type="text/javascript"></script>
<!-- Bootstrap WYSIHTML5 -->
<script th:src="@{/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js}" type="text/javascript"></script>
<!-- Slimscroll -->
<script th:src="@{/bower_components/jquery-slimscroll/jquery.slimscroll.min.js}" type="text/javascript"></script>
<!-- FastClick -->
<script th:src="@{/bower_components/fastclick/lib/fastclick.js}" type="text/javascript"></script>
<!-- AdminLTE App -->
<script th:src="@{/dist/js/adminlte.min.js}" type="text/javascript"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script th:src="@{/dist/js/pages/dashboard.js}" type="text/javascript"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/dist/js/demo.js}" type="text/javascript"></script>


<script type="text/javascript">
    $(function () {
        $('.sidebar-menu li:not(.treeview) > a').on('click', function () {
            console.log(this.href);
            var $parent = $(this).parent().addClass('active');
            $parent.siblings('.treeview.active').find('> a').trigger('click');
            $parent.siblings().removeClass('active').find('li').removeClass('active');
        });
        $('.sidebar-menu a').each(function () {
            if (this.href === window.location.href) {
                $(this).parent().addClass('active')
                    .closest('.treeview-menu').addClass('.menu-open')
                    .closest('.treeview').addClass('active');
            }
        });


    });

</script>
</body>
</html>
